import router from "./index";
import { getToken } from "@/utils/token";
const whiteList = ["/login"];
router.beforeEach((to, _, next) => {
    // 非白名单请求验证token，不存在则退回登录
    if (!whiteList.includes(to.fullPath)) {
        const token = getToken();
        if (!token) {
            next("/login");
            return;
        }
    }
    next();
});
